package com.example.app.components


import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.size
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp

@Composable
fun RowSample() {
    // 和纵向一样有排列方式和对齐方式, 但是这里的排列是横向排列和纵向对齐
    Row(modifier = Modifier
        .size(200.dp)
        .background(Color.Magenta),
        horizontalArrangement = Arrangement.Center,
        verticalAlignment = Alignment.Bottom
    ) {
        Text(text = "row1")
        Text(text = "row2")
    }
}

@Preview(
    showSystemUi = true
)
@Composable
fun RowSamplePreview() {
    RowSample()
}

